package com.example.dobs.demo.flink.io.tool;

import com.google.protobuf.Message;
import org.apache.flink.api.common.serialization.Encoder;

import java.io.IOException;
import java.io.OutputStream;

/**
 * Encoder that write protobuf message to stream
 */
public class MessageEncoder implements Encoder<Message> {
    @Override
    public void encode(Message element, OutputStream stream) throws IOException {
        element.writeDelimitedTo(stream);
    }
}
